# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy


class ListPageItem(scrapy.Item):
    """
    表名：list_page
    每个地区不同分类的，不同菜系对应待爬取的url
    """
    # 详情url
    detail_url = scrapy.Field()
    # 所属类别
    detail_describe = scrapy.Field()
    # 细分标签
    label = scrapy.Field()
    # 地区
    region = scrapy.Field()


class ShopInfoItem(scrapy.Item):
    """
    表名：shop_info
    店铺信息所有字段定义
    页面内容通过两部分来获取，所有店铺的列表页及单个店铺的详情页
    """
    # 在当前细分标签中所属排名
    _rank = scrapy.Field()
    # 店铺名称
    shop_name = scrapy.Field()
    # 别名
    another_name = scrapy.Field()
    # 店铺ID
    shop_id = scrapy.Field()
    # 店铺标签
    shop_tags = scrapy.Field()
    # 星级
    star_level = scrapy.Field()
    # 商业区
    district = scrapy.Field()
    # 口味
    taste = scrapy.Field()
    # 环境
    environment = scrapy.Field()
    # 服务
    serve = scrapy.Field()
    # 人均消费
    average_price = scrapy.Field()
    # 地区
    region = scrapy.Field()
    # 类别
    category = scrapy.Field()
    # 餐厅简介
    restaurant_abstract = scrapy.Field()
    # 评论数量
    comment_number = scrapy.Field()
    # 详细地址
    detailed_address = scrapy.Field()
    # 联系方式
    contact_way = scrapy.Field()
    # 营业时间
    business_hours = scrapy.Field()
    # 经度
    lng = scrapy.Field()
    # 纬度
    lat = scrapy.Field()


class CommentItem(scrapy.Item):
    """
    表名：shop_comment
    评论数据所有相关字断定义
    """
    # 唯一键：店铺ID + 用户名称 + 评论时间
    sku_number = scrapy.Field()
    # 店铺ID
    shop_id = scrapy.Field()
    # 用户名称
    user_name = scrapy.Field()
    # 是否是VIP。 0 否，1 是
    is_vip = scrapy.Field()
    # 用户级别
    user_level = scrapy.Field()
    # 评论星数
    star_level = scrapy.Field()
    # 口味
    taste = scrapy.Field()
    # 环境
    environment = scrapy.Field()
    # 服务
    serve = scrapy.Field()
    # 人均消费
    average_price = scrapy.Field()
    # 评论时间
    comment_time = scrapy.Field()
    # 评论内容
    comment = scrapy.Field()
    # 喜欢的菜
    favorite_dishes = scrapy.Field()
    # 点赞数量
    thumbs_up = scrapy.Field()
